{% extends "base.html" %}

{% block title %}HIT | Hegelian Inquiry Tool - Summary of Thesis{% endblock %}
{% block pagetitle %}Summary of thesis triangulation{% endblock %}

{% block content %}
	<IMG SRC="/static/img/bar/{{anti}}summary.png" WIDTH=900 ALT="Progress Bar" style="margin-bottom: 20px">
	{% if triangulation %}
		<h1>Summary of Thesis Triangulation</h1><br />
		Subject: {{ triangulation.subject }}<br />
		Thesis:<br />
		<div class="text_no_scroll">
			{{ triangulation.thesis|linebreaksbr }}
		</div><br />
		Thesis link: <a href="{{ link }}" target="_blank">{{ link }}</a>
		<br /><br />
		
		{% if data_result %}
			<h2>Data triangulation</h2> <div class="reliability">Reliability: {{ data_result.reliability }}%</div><br />
			<hr /><br /><br />
			<h3>Checked links:</h3><br />
			{% if data_result.links|length != 0 %}
				{% for l in data_result.links %}
					<a href="{{ l }}" target="_blank">{{ l }}</a><br />
				{% endfor %}
			{% else %}
				No links checked.<br />
			{% endif %}
			<br />
			<h3>Notes</h3><br />
			<div class="text">
			{{ data_result.notes|linebreaksbr }}
			</div><br />
		{% endif %}
		
		{% if investigator_result %}
			<h2>Investigator triangulation:</h2> <div class="reliability">Reliability: {{ investigator_result.reliability }}%</div><br />
			<hr /><br /><br />
			<h3>Checked links:</h3><br />
			{% if investigator_result.links|length != 0 %}
				{% for l in investigator_result.links %}
					<a href="{{ l }}" target="_blank">{{ l }}</a><br />
				{% endfor %}
			{% else %}
				No links about the author found.<br />
			{% endif %}
			<br />
			<h3>Additional information:</h3><br />
			<div class="text">
				{{ investigator_result.additional_info|linebreaksbr }}
			</div>
			<br /><br />
			
			<h3>Whois-results:</h3><br />
			<div class="text">
				{{ investigator_result.whoisdata|linebreaksbr }}
			</div>
			<br /><br />
			
			<h3>Notes</h3><br />
			<div class="text">
				{{ investigator_result.notes|linebreaksbr }}
			</div><br />
		{% endif %}
		
		{% if theory_result %}
			<h2>Theory triangulation:</h2> <div class="reliability">Reliability: {{ theory_result.reliability }}%</div><br />
			<hr /><br /><br />
			
<h1>Causal Network</h1>
<script type="text/javascript" src="/static/js/raphael-min.js"></script>
<script type="text/javascript" src="/static/js/dracula_graffle.js"></script>
<script type="text/javascript" src="/static/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/static/js/dracula_graph.js"></script>

<script type="text/javascript">
var redraw, g, renderer;
window.onload = function() {
    var width = 900;
    var height = 900;    
    g = new Graph();
    
    {{alchemy|safe}}
    
    /* layout the graph using the Spring layout implementation */
    var layouter = new Graph.Layout.Spring(g);    
    /* draw the graph using the RaphaelJS draw implementation */
    renderer = new Graph.Renderer.Raphael('canvas', g, width, height);    
    redraw = function() {
        layouter.layout();
        renderer.draw();
    };
    hide = function(id) {
        g.nodes[id].hide();
    };
    show = function(id) {
        g.nodes[id].show();
    };

};
</script>
<div id="canvas"></div>
<button id="redraw" onclick="redraw();">redraw</button>
<br><br>
<h1>Sentiment Analysis</h1><br>
{{sentiment|safe}}


			<h3>Notes</h3><br />
			<div class="text">
				{{ theory_result.notes|linebreaksbr }}
			</div><br />
		{% endif %}
		
		{% if method_result %}
			<h2>Method triangulation:</h2> <div class="reliability">Reliability: {{ method_result.reliability }}%</div><br />
			<hr /><br /><br />
			
			<h3>Methods:</h3><br />
			{% if method_result.methods|length != 0 %}
				<ul>
				{% for m in method_result.methods %}
					<li>{{  m }}</li>
				{% endfor %}
				</ul>
			{% else %}
				No methods checked.<br />
			{% endif %}
			<br />
			
			<h3>Notes</h3><br />
			<div class="text">
				{{ method_result.notes|linebreaksbr }}
			</div><br />
		{% endif %}
		
		<h2>Overall reliability</h2><br />
		<hr /><br /><br />
		<form method="POST" action="{%url HIT.Triangulator.views.save_reliability_continue_antithesis %}" name="reliabilityform">
			{% csrf_token %}
			Give a ranking for reliability: <input type="text" name="reliability" value="0" />%
		</form>
		<br /><br />
		<div class="buttons">
			<span><button onclick="document.reliabilityform.action = '{% url HIT.Triangulator.views.save_reliability_stop %}'; document.reliabilityform.submit();">Save but stop</button></span> | 
			<span><a href="{% url HIT.Triangulator.views.modify_thesis %}">Modify Thesis</a></span>
			<span class="next"><button onclick="document.reliabilityform.action = '{% url HIT.Triangulator.views.save_reliability_continue_antithesis %}'; document.reliabilityform.submit();">Accept, continue with antithesis</button></span>
		</div>
		
	{% endif %}
{% endblock %}
